home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / FILES.SWG / 0035_Hiding-Unhiding Files.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-02  |  718b  |  38 lines

  1. {
  2. Herbert Zarb <panther!jaguar!hzarb@relay.iunet.it>
  3.  
  4.   This simple Program changes the attribute of the File or directory from
  5.    hidden to archive or vice-versa...
  6. }
  7.  
  8. Program hide_unhide;
  9. { Accepts two command line parameters :
  10.         1st parameter can be either +h (hide) or -h(unhide).
  11.         2nd parameter must be the full path }
  12. Uses
  13.   Dos;
  14.  
  15. Const
  16.   bell    = #07;
  17.   hidden  = $02;
  18.   archive = $20;
  19.  
  20. Var
  21.   f : File;
  22.  
  23. begin
  24.   if paramcount >= 2 then
  25.   begin
  26.     Assign(f, paramstr(2));
  27.     if paramstr(1) = '+h' then
  28.       SetFAttr(f, hidden)
  29.     else
  30.     if paramstr(1) = '-h' then
  31.       SetFAttr(f, Archive)
  32.     else
  33.       Write(bell);
  34.   end
  35.   else
  36.     Write(bell);
  37. end.
  38.